package com.springboot.demo.core.constant;

import lombok.Data;

/**
 * 异常信息 key and value
 * @author Francis
 * @date 2019-02-24 11:20
 */
@Data
public class CodeMsg {

    private int code;
    private String msg;

    private CodeMsg( int code,String msg) {
        this.code = code;
        this.msg = msg;
    }



    public static CodeMsg PARAM_NOT_PASS  = new CodeMsg(1000, "参数校验不通过");

    public static CodeMsg DB_ERROR  = new CodeMsg(1100, "数据库异常");
    public static CodeMsg LOGIN_NAME_HAS_EXIST  = new CodeMsg(1101, "登录名已经存在，请重新设置");


    /**
     * insert异常
     */
    public static CodeMsg INSERT_ERROR  = new CodeMsg(1200, "新增数据失败，请检查数据有效性。");

    /**
     * update delete异常
     */
    public static CodeMsg DATA_DEAL_ERROR  = new CodeMsg(1201, "未处理到任何一行");

    /**
     * select异常
     */
    public static CodeMsg DATA_IS_EMPTY  = new CodeMsg(1202, "未查询到任何一条数据");


    /**
     * redis存储
     */
    public static CodeMsg KEY_AND_VALUE_MUST_BE_NOT_EMPTY  = new CodeMsg(1300, "Key And Value Must Be Not Empty");
    public static CodeMsg KEY_MUST_BE_NOT_EMPTY  = new CodeMsg(1301, "Key Must Be Not Empty");
    public static CodeMsg CLASS_MUST_BE_NOT_EMPTY  = new CodeMsg(1302, "Class Must Be Not Empty");
    public static CodeMsg TIME_AND_UNIT_MUST_BE_NOT_EMPTY  = new CodeMsg(1303, "失效时间和时间单位，均不能为空");



}